// 路径
import type {AdminLoginForm, AdminLoginRespInfo, AdminLogoutResp, GetAdminResp} from "@/type/admin.ts";
import {adminRequest} from "@/utils/request.ts";

enum API {
    LOGIN_URL = '/admin/login',
    LOGOUT_URL = '/admin/logout',
    ADMIN_INFO_URL = '/admin/info'
}

// 暴露函数
// 登录
export const reqAdminLogin = (data: AdminLoginForm) => adminRequest.post<any,AdminLoginRespInfo>(API.LOGIN_URL, data)
// 登出
export const reqAdminLogout = () => adminRequest.post<any, AdminLogoutResp>(API.LOGOUT_URL)
// 获取用户信息
export const getAdminInfo = () => adminRequest.get<any, GetAdminResp>(API.ADMIN_INFO_URL)
